package com.gzmu.face.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.gzmu.face.entity.Faceinfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xiaobo Yan
 * @since 2020-05-07
 */
@Mapper
public interface FaceinfoMapper extends BaseMapper<Faceinfo> {
    @Insert("INSERT INTO t_faceinfo(faceid,pername,idcardNum,idcardper,imgdata,stime,etime,pertype,usrtype,gender,birthday," +
            "nation,telnum,place,position,address,notes,room,createtime,remark) VALUES (#{faceid},#{pername},#{idcardNum},#{idcardper}," +
            "#{imgdata},#{stime},#{etime},#{pertype},#{usrtype},#{gender},#{birthday},#{nation},#{telnum},#{place},#{position},#{address}," +
            "#{notes},#{room},now(),#{remark}) ON DUPLICATE KEY UPDATE faceid=#{faceid},pername=#{pername},idcardNum=#{idcardNum}," +
            "idcardper=#{idcardper},imgdata=#{imgdata},stime=#{stime},etime=#{etime},pertype=#{pertype},usrtype=#{usrtype}," +
            "gender=#{gender},birthday=#{birthday},nation=#{nation},telnum=#{telnum},place=#{place},address=#{address},notes=#{notes}," +
            "address=#{address},remark=#{remark}")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    Integer insertFaceInfo(Faceinfo person);
}
